using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;

namespace QuanLySieuThi_08520114_08520220
{
    public partial class HoaDonReport : DevExpress.XtraReports.UI.XtraReport
    {

        public HoaDonReport()
        {
            InitializeComponent();
        }

        public void bind_data(DataRow data)
        {
            MaCl.DataBindings.Add("Text", DataSource, "MaMatHang");
            TenCl.DataBindings.Add("Text", DataSource, "TenMatHang");
            SoLuongCl.DataBindings.Add("Text", DataSource, "SoLuong");
            DVTCl.DataBindings.Add("Text", DataSource, "TenDonViTinh");
            ThanhTienCl.DataBindings.Add("Text", DataSource, "ThanhTien");
            MaHoaDonLb.Text = MaHoaDonLb.Text + " " + data["MaHoaDon"].ToString();
            string[] temp =  data["NgayXuatHoaDon"].ToString().Split(' ');
            NgayLb.Text = NgayLb.Text + " " + temp[0];
            NhanVienLb.Text = NhanVienLb.Text + " " + data["TenNhanVien"].ToString();
            TTLb.Text = TTLb.Text + " " + data["MaSoQuayTT"].ToString();
            tienLb.Text = data["TongTienPhaiTra"].ToString();
        }
        int i = 0;

        private void xrTable2_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            i++;

            STT.Text = i.ToString();
        }
    }
}
